1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Neon Golden | City Surf source code

neongolden_headerThe scripts relies on a number of vector flourishes (swirls, bits and splatters).
Those are not included here so you need to roll your own.

neongolden7

svg = ximport("svg")
colors = ximport("colors")
noise = ximport("noise")
 
swirls = files("Swirls/*.svg")
bits = files("Bits/*.svg")
splatter = files("Splatter/*.svg")
 
w = 500
h = w * 1.41428571429 # din ratio
 
size(w, h)
background(0);
 
colormode(CMYK)
outputmode(RGB)
 
colors.shadow(dx=0, dy=0, alpha=0.5, blur=20.0)
 
clrs0 = colors.list(
    color(0, 0, 0, 100, 1),
    #color(0, 0, 0, 0, 1)
)
 
clrs1 = colors.list(
    color(100, 0, 0, 0, 1),
    color(0, 100, 0, 0, 1),
    color(0, 0, 100, 0, 1),
    color(0, 0, 0, 100, 1),
    color(0, 0, 0, 0, 1)
)
#clrs1.swarm(50, 50)
 
clrs2 = colors.list(
    colors.lime(),
    color(0, 100, 0, 0, 1),
    color(0, 0, 0, 50, 1),
    color(0, 0, 0, 100, 1),
    color(0, 0, 0, 0, 1)    
)
 
def draw_object(obj, item, clrs, factor):
    
    print item
 
    file = choice(obj)
    print file
    data = open(file).read()
    obj = svg.parse(data)
 
    translate(random(0,w-200), random(0,h-200))
    scale(item/factor)
    rotate(random(0,360))
 
    for path in obj:
        nostroke()
        #fill(path.fill)
        c = choice(clrs).analog(angle=2, d=0.1)
        c.a = item/29.0*2
        #c.a = (29.0-item)/29
        print c.a
        fill(c)
        drawpath(path)
    
    reset()
 
for item in range(10):
    draw_object(splatter, item, clrs0, 2)    
 
for item in range(30):
    draw_object(swirls, item, clrs2, 7)
    
    if random(0,1) > 0.5:
        draw_object(bits, item, clrs2, 14)